<?php use_helper('Text') ?>
<?php use_helper('Slug') ?>
<?php if ($sf_user->hasCredential("MOD_NEWS"))
	{?>
<div class="title_section">
	News 
</div>
<div class="section">

<?php foreach($newss as $news):?>
	<ul class="elem_on_section">
    	<li class="inline" style="width:80%;">
        	<?php echo $news["titre"] ?>
        </li>
        <li class="inline">
        	<?php echo get_component('headers', 'moderation', array('Mtype' => "edit", 'MCred' => "MOD_NEWS", 'MModule' => "news", 'MAction' => "edit", "Mid" => $news["idnews"])) ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "delete", 'MCred' => "SUPPR_NEWS", 'MModule' => "news", 'MAction' => "delete", "Mid" => $news["idnews"])) ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "online", 'MCred' => "MOD_NEWS", 'MModule' => "news", 'MAction' => "online", "Mid" => $news["idnews"])); ?>
        </li>
    </ul>
<?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MOD_REVISION"))
{
?>
<div class="title_section">
	Nouveaux articles
</div>
<div class="section">
	<ul class="titre_elem">
    <li class="inline" style="width: 50px"> Categorie </li>
    <li class="inline" style="width: 100px"> Disponible pour </li>
    <li class="inline" style="width: 390px"> Titre</li>
    <li class="inline" style="width: 40px"> Coms </li>
  </ul>
  
	<?php foreach($articles as $article):?>
    	<ul class="elem_on_section">
    
    <li class="inline" style="width: 50px"> <?php echo image_tag("Categories/".$article->getArticles()->getCategories()->getId(), array("width" => 25,"height" => 25, "alt" => "pict", "title" => $article->getArticles()->getCategories()->getNom())) ?> </li>
    <li class="inline" style="width: 100px">
      <?php echo image_tag("Platform/".$article["Platform"]["picture"].".png", array("width" => 25,"height" => 25, "alt" => "pict", "title" => $article["Platform"]["real_name"])) ?>
    </li>
    <li class="inline" style="width: 390px"> <a class="link_title" href="<?php echo url_for('@show_article?title='.sluggify($article["Articles"]["title"]).'&idasso='.$article["idassoplatform"]); ?>"><?php echo $article["Articles"]["title"] ?></a></li>
    
    	<li class="inline" style="width: 40px"> <?php echo count($article["Commentaires"]) ?> </li>
        <li class="inline">
        	<?php echo get_component('headers', 'moderation', array('Mtype' => "edit", 'MCred' => "MOD_ARTICLE", 'MModule' => "article", 'MAction' => "edit", "Mid" => $article["Articles"]["idarticles"])); ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "delete", 'MCred' => "SUPPR_ARTICLE", 'MModule' => "article", 'MAction' => "delete", "Mid" => $article["Articles"]["idarticles"])); ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "online", 'MCred' => "MOD_ARTICLE", 'MModule' => "article", 'MAction' => "online", "Mid" => $article["Articles"]["idarticles"])); ?>
        </li>
    </ul>
    <?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MOD_REVISION"))
{
?>
<div class="title_section">
	Nouvelles révisions
</div>
<div class="section">
	<ul class="titre_elem">
        	<li class="inline" style="width: 50px">
            	Auteur
            </li>
            <li class="inline" style="width: 320px">
            	Article
            </li>
            <li class="inline" style="width: 300px">
            	Commentaire
            </li>
         </ul>
	<?php foreach($revisions as $revision):?>
    	<ul class="elem_on_section">
        	<li class="inline" style="width: 50px">
            	<?php echo $revision["SfGuardUserProfile"]["User"]["username"] ?>
            </li>
            <li class="inline" style="width: 320px">
            	<a class="link_title" href="<?php echo url_for('@show_article?title='.sluggify($revision["Assoplatform"]["Articles"]["title"]).'&idasso='.$revision["Assoplatform"]["idassoplatform"]); ?>"><?php echo $revision["Assoplatform"]["Articles"]["title"] ?></a>
            </li>
            <li class="inline" style="width: 300px">
            	<?php echo $revision["commentaire"] ?>
            </li>
         </ul>
    <?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MOD_USER"))
{
?>
<div class="title_section">
	Nouveaux membres
</div>
<div class="section">
	<?php foreach($membres as $membre):?>
    	<ul class="elem_on_section">
        	<li><a class="link_title" href="<?php echo url_for('compte/show?idprofil='.$membre["id"]); ?>"><?php echo $membre["User"]["username"] ?></a></li>
         </ul>
    <?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MODERATION_ALERT"))
{
?>
<div class="title_section">
	Nouvelles alertes
</div>
<div class="section">
	<?php foreach($alerts as $alert):?>
    	<ul class="elem_on_section">
        	<li>Par: <a class="link_title" href="<?php echo url_for('compte/show?idprofil='.$alert["SfGuardUserProfile"]["id"]); ?>"><?php echo $alert["SfGuardUserProfile"]["User"]["username"] ?></a></li>
            <li>Sur: <a class="link_title" href="<?php echo url_for('@show_article?title='.sluggify($alert["Assoplatform"]["Articles"]["title"]).'&idasso='.$alert["Assoplatform"]["idassoplatform"]); ?>"><?php echo $alert["Assoplatform"]["Articles"]["title"] ?></a></li>
            <li>Motif: <?php echo $alert["raison"] ?></li>
            <li><?php echo $alert["commentaire"] ?></li>
         </ul>
    <?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MOD_LEXIQUE"))
{
?>
<div class="title_section">
	Nouveaux mots
</div>
<div class="section">
	<?php foreach($words as $word):?>
    	<ul class="elem_on_section">
        	<li class="inline" style="width:85%">
            	<a class="link_title" href="<?php echo url_for('lexique/index?id='.$word["idlexique_mot"]); ?>"> <?php echo $word["mot"]?> </a>
            </li>
            <li class="inline">
            	<?php echo get_component('headers', 'moderation', array('Mtype' => "edit", 'MCred' => "MOD_MOT", 'MModule' => "lexique", 'MAction' => "edit", "Mid" => $lexique["idlexique_mot"])); ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "delete", 'MCred' => "SUPPR_MOT", 'MModule' => "lexique", 'MAction' => "delete", "Mid" => $lexique["idlexique_mot"])); ?> <?php echo get_component('headers', 'moderation', array('Mtype' => "online", 'MCred' => "MOD_MOT", 'MModule' => "lexique", 'MAction' => "online", "Mid" => $lexique["idlexique_mot"])); ?>
            </li>
         </ul>
    <?php endforeach;?>
</div>
<?php 
}
if ($sf_user->hasCredential("MODERATION_DEFS"))
{
?>
<div class="title_section">
	Nouvelles définitions
</div>
<div class="section">
	<?php foreach($defis as $def):?>
    	<ul class="elem_on_section">
        	<li>
            	<a class="link_title" href="<?php echo url_for('lexique/index?id='.$def["Lexiquemot"]["idlexique_mot"]); ?>"> <?php echo $def["Lexiquemot"]["mot"]?> </a>
            </li>
            <li>
            	<?php echo $def["definition"] ?>
            </li>
            <li>
            	<?php echo get_component('headers', 'moderation', array('Mtype' => "edit", 'MCred' => "MOD_DEF", 'MModule' => "definition", 'MAction' => "edit", "Mid" => $definition["idlexique_definition"])); ?>
                        <?php echo get_component('headers', 'moderation', array('Mtype' => "delete", 'MCred' => "SUPPR_DEF", 'MModule' => "definition", 'MAction' => "delete", "Mid" => $definition["idlexique_definition"])); ?>
                        <?php echo get_component('headers', 'moderation', array('Mtype' => "online", 'MCred' => "MOD_DEF", 'MModule' => "definition", 'MAction' => "online", "Mid" => $definition["idlexique_definition"])); ?>
            </li>
         </ul>
    <?php endforeach;?>
</div>

<?php }?>